<#include "/common/head.ftl">

<@showTitle title="${i18n.getMessage('candidate')} > ${i18n.getMessage('search')}">
<#if (candidates?? && candidates?size > 0)>
	<a href="#" onclick="cc('englishtest/cache.sgt')">${i18n.getMessage('cache.search')}</a>
</#if>
</@showTitle>

<form action="englishtest/searchCandidate.sgt" onsubmit="submitForm(this); return false;">
	<table id="dataTable" align="center" cellpadding="0" cellspacing="5" style="width: 800px;"><tr>
		<td class="name">${i18n.getMessage('candidate.code')}: </td>
		<td><input type="text" name="candidateCode" value="${(searchCandidate.candidateCode)!}" class="w200"/> </td>
		<td class="name w100">${i18n.getMessage('nickName')}: </td>
		<td><input type="text" name="nickName" value="${(searchCandidate.nickName)!}" class="w200"/> </td>
	</tr><tr>
		<td class="name">${i18n.getMessage('firstName')}: </td>
		<td><input type="text" name="firstName" value="${(searchCandidate.firstName)!}" class="w200"/> </td>
		<td class="name w100">${i18n.getMessage('lastName')}: </td>
		<td><input type="text" name="lastName" value="${(searchCandidate.lastName)!}" class="w200"/> </td>
	</tr><tr>
		<td class="name">${i18n.getMessage('dateOfBirth')}: </td>
		<td><input type="text" name="dateOfBirth" value="${(searchCandidate.dateOfBirth?date)!}" class="w200"/><img class="calendarImg" src="images/calendar/calendar.gif" onclick="displayCalendar(document.forms[0].dateOfBirth, '${i18n.getMessage('format.date')}', this)"/></td>
		<td class="name w100">${i18n.getMessage('gender')}: </td>
		<td>
			<input type="radio" name="gender" value="MALE"/> ${i18n.getMessage('gender.male')}
			<input type="radio" name="gender" value="FEMALE"/> ${i18n.getMessage('gender.female')}
		</td>
	</tr><tr>
		<td class="name">${i18n.getMessage('address')}: </td>
		<td><input type="text" name="address" value="${(searchCandidate.address)!}" class="w200"/></td>
		<td class="name w100">${i18n.getMessage('email')}: </td>
		<td><input type="text" name="email" value="${(searchCandidate.email)!}" class="w200"/></td>
	</tr><tr>
		<td class="name">Registered Date:</td>
		<td><input type="text" name="registeredDate" value="${(searchCandidate.registeredDate?date)!}" style="width:200px"/><img class="calendarImg" src="images/calendar/calendar.gif" onclick="displayCalendar(document.forms[0].registeredDate, '${i18n.getMessage('format.date')}', this)"/></td>
		<td class="name w100">${i18n.getMessage('phoneNumber')}: </td>
		<td><input type="text" name="phoneNumber" value="${(searchCandidate.phoneNumber)!}" class="w200"/></td>
	</tr><tr>
		<td class="name">${i18n.getMessage('type')}:</td>
		<td><select name="typeId" style="width:204px">
			<option></option>
			<#list types as type>
				<option value="${(type.id)!}" <#if (type = (searchCandidate.type)!)>selected</#if> >${(type.name)!}</option>
			</#list>
		</select></td>
		<td class="name w100">${i18n.getMessage('Consultant')}:</td>
		<td><select name="consultantId" class="w200">
			<option></option>
			<optgroup label="Active">
				<#list consultants as consultant>
					<#if consultant.active>
						<option value="${(consultant.id)!}" style="<@formatOnConsultant consultant/>">${(consultant.fullName)!}</option>								
					</#if>
				</#list>					
			</optgroup>
			<optgroup label="Inactive">
				<#list consultants as consultant>
					<#if !consultant.active>
						<option value="${(consultant.id)!}" style="<@formatOnConsultant consultant/>">${(consultant.fullName)!}</option>								
					</#if>
				</#list>					
			</optgroup>
		</select></td>
	</tr><tr>
		<td class="name" style="vertical-align:top">${i18n.getMessage('comment')}: </td>
		<td colspan="3"><textarea name="comment" class="w350 h075">${(searchCandidate.comment)!}</textarea></td>
	</tr><tr>
		<td class="name"></td>
		<td>
			<input type="submit" value="${i18n.getMessage('search')}" class="button_style"/> 
			<input type="reset" value="${i18n.getMessage('reset')}" class="button_style"/> 
		</td>
	</tr></table>
</form>